package net.comm.param.web.form;

import net.comm.page.PageCtr;

import org.apache.struts.action.*;

public class PropertyForm extends ActionForm {

	private static final long serialVersionUID = 1L;
	private static final String KEY_SPLIT = "#,##,#,#,#";
	
	private int  QryAssortID = 0;	//所属分类ID
	private int  QryExichiflag = 0;	//是否存在子属性
	private int  QryParentID = 0;		//父属性ID

	private int  AssortID = 0;		//所属分类ID
	private int  PropID = 0;		//属性ID
	private String  Propname = "";	//属性名称
	private String  Assortname = "";//分类名称
	private int  ParentID = 0;		//父属性ID
	private int  DisNO = 0;			//显示顺序
	private int  Exichiflag = 0;	//是否存在子属性
	private int  UserID;
	private String  MTime;

	/**
	 * 查询当前页主键值串
	 */
	private String key = "";

	/**
	 * 查询上上页主键值串
	 */
	private String lastKey = "";
	

	/**
	 * 分页控制对象
	 */
	private PageCtr page;
	


	private String action = "";

	public PageCtr getPage() {
		return page;
	}

	public void setPage(PageCtr page) {
		this.page = page;
	}
	
	/**
	 * @param key the key to set
	 */
	public void setKey(String key) {
		this.key = key;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String[] array) {
		if(key != null && key.trim().length() > 0) {
			key = "";
		}
		
		StringBuffer keyBuff = new StringBuffer();
		for (int i = 0; i < array.length; i++) 
		{
			/**
			 * 防止空字符串引起的split方法异常
			 */
			if(array[i] == null || array[i].length() == 0) {
				keyBuff.append(" ");
			} else {
				keyBuff.append(array[i]);
			}
			
			keyBuff.append(KEY_SPLIT);
		}
		
		key = keyBuff.toString();		
	}
	
	/**
	 * 获取lastKey值
	 * @return
	 */
	public String[] lastKey()
	{
		if(lastKey == null || lastKey.trim().length() == 0) {
			return null;
		}
		
		return lastKey.split(KEY_SPLIT);
	}
	
	public String getLastKey() {
		return lastKey;
	}

	public void setLastKey(String lastKey) {
		this.lastKey = lastKey;
	}

	public String getAction() {
		return action;
	}
	public void setAction(String action) {
		this.action = action;
	}
	
	public static String getKEY_SPLIT() {
		return KEY_SPLIT;
	}


	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public int getPropID() {
		return PropID;
	}

	public void setPropID(int propID) {
		PropID = propID;
	}

	public String getPropname() {
		return Propname;
	}

	public void setPropname(String propname) {
		Propname = propname;
	}



	public int getAssortID() {
		return AssortID;
	}

	public void setAssortID(int assortID) {
		AssortID = assortID;
	}

	public void setQryAssortID(int qryAssortID) {
		QryAssortID = qryAssortID;
	}

	public String getAssortname() {
		return Assortname;
	}

	public void setAssortname(String assortname) {
		Assortname = assortname;
	}

	public int getParentID() {
		return ParentID;
	}

	public void setParentID(int parentID) {
		ParentID = parentID;
	}

	public int getDisNO() {
		return DisNO;
	}

	public void setDisNO(int disNO) {
		DisNO = disNO;
	}

	public int getExichiflag() {
		return Exichiflag;
	}

	public void setExichiflag(int exichiflag) {
		Exichiflag = exichiflag;
	}

	public String getMTime() {
		return MTime;
	}


	public int getUserID() {
		return UserID;
	}

	public void setUserID(int userID) {
		UserID = userID;
	}

	public void setMTime(String time) {
		MTime = time;
	}

	public int getQryExichiflag() {
		return QryExichiflag;
	}

	public void setQryExichiflag(int qryExichiflag) {
		QryExichiflag = qryExichiflag;
	}

	public int getQryAssortID() {
		return QryAssortID;
	}

	public int getQryParentID() {
		return QryParentID;
	}

	public void setQryParentID(int qryParentID) {
		QryParentID = qryParentID;
	}
	
}